// fish_game/assets/fish_pixel_art.js

export const PIXEL_ART_FISH = [
    // Fish 0: Player Fish - More vivid yellow fish
    {
        name: "Player Yellow Fish",
        sizeFactor: 1.0,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 2, 2, 1, 1, 1],
            [1, 1, 2, 3, 2, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "yellow", 2: "orange", 3: "darkorange", 4: "black", 0: null }, // Added color 4 for pupil
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 1: Small Blue Fish
    {
        name: "Small Blue Fish",
        sizeFactor: 0.8,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "skyblue", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 2: Green Round Fish
    {
        name: "Green Round Fish",
        sizeFactor: 1.2,
        pixels: [
            [0, 0, 0, 1, 1, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "lightgreen", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 3: Red Spiky Fish
    {
        name: "Red Spiky Fish",
        sizeFactor: 1.1,
        pixels: [
            [0, 0, 0, 1, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 1, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "red", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 4: Purple Angler Fish
    {
        name: "Purple Angler Fish",
        sizeFactor: 1.5,
        pixels: [
            [0, 0, 0, 0, 1, 0, 0, 0],
            [0, 0, 0, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 1, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "purple", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 5: Orange Clown Fish
    {
        name: "Orange Clown Fish",
        sizeFactor: 0.9,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "orange", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 6: Pink Jellyfish (more abstract)
    {
        name: "Pink Jellyfish",
        sizeFactor: 0.7,
        pixels: [
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [0, 1, 0, 1, 0, 1, 0, 0],
            [0, 0, 1, 0, 1, 0, 0, 0],
            [0, 0, 0, 1, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "pink", 0: null },
        eye: null, // No eyes for jellyfish
        mouth: null // No mouth for jellyfish
    },
    // Fish 7: Gray Shark (simplified)
    {
        name: "Gray Shark",
        sizeFactor: 1.8,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 0, 0, 0],
            [0, 0, 1, 1, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "gray", 0: null },
        eye: { x: 4, y: 2 },
        mouth: { x: 6, y: 3 }
    },
    // Fish 8: Cyan Tropical Fish
    {
        name: "Cyan Tropical Fish",
        sizeFactor: 1.0,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "cyan", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 9: Brown Flat Fish
    {
        name: "Brown Flat Fish",
        sizeFactor: 1.3,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "saddlebrown", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 10: Golden Fish
    {
        name: "Golden Fish",
        sizeFactor: 1.0,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "gold", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 11: Dark Green Eel
    {
        name: "Dark Green Eel",
        sizeFactor: 1.6,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "darkgreen", 0: null },
        eye: { x: 6, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 12: Light Pink Guppy
    {
        name: "Light Pink Guppy",
        sizeFactor: 0.8,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "lightpink", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 13: Dark Blue Barracuda
    {
        name: "Dark Blue Barracuda",
        sizeFactor: 1.7,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "darkblue", 0: null },
        eye: { x: 6, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 14: White Goldfish
    {
        name: "White Goldfish",
        sizeFactor: 1.0,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "white", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 15: Black Molly
    {
        name: "Black Molly",
        sizeFactor: 0.9,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "black", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 16: Silver Arowana
    {
        name: "Silver Arowana",
        sizeFactor: 1.9,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "silver", 0: null },
        eye: { x: 6, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 17: Rainbow Trout
    {
        name: "Rainbow Trout",
        sizeFactor: 1.4,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "lightgray", 0: null }, // Base color
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 18: Blue Tang
    {
        name: "Blue Tang",
        sizeFactor: 1.0,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "blue", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 19: Green Pufferfish
    {
        name: "Green Pufferfish",
        sizeFactor: 1.3,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "limegreen", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 20: Yellow Boxfish
    {
        name: "Yellow Boxfish",
        sizeFactor: 1.1,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "gold", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 21: Striped Bass
    {
        name: "Striped Bass",
        sizeFactor: 1.5,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "darkslategray", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 22: Small Silver Fish
    {
        name: "Small Silver Fish",
        sizeFactor: 0.7,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "silver", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 23: Spotted Leopard Fish
    {
        name: "Spotted Leopard Fish",
        sizeFactor: 1.2,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "darkorange", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 24: Green Eel (different pattern)
    {
        name: "Green Eel",
        sizeFactor: 1.6,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 1, 1],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "forestgreen", 0: null },
        eye: { x: 6, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 25: White and Red Discus
    {
        name: "White and Red Discus",
        sizeFactor: 1.4,
        pixels: [
            [0, 0, 0, 1, 1, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [0, 0, 0, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "white", 2: "red", 0: null }, // Assuming some pattern for red
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    },
    // Fish 26: Small Yellow Dot Fish
    {
        name: "Small Yellow Dot Fish",
        sizeFactor: 0.7,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 0, 0, 0],
            [1, 1, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 0, 0, 0],
            [0, 0, 1, 1, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "yellow", 0: null },
        eye: { x: 3, y: 3 },
        mouth: { x: 5, y: 4 }
    },
    // Fish 27: Blue spotted fish
    {
        name: "Blue Spotted Fish",
        sizeFactor: 1.1,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 1, 0, 0],
            [0, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "blue", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 28: Green striped fish
    {
        name: "Green Striped Fish",
        sizeFactor: 1.3,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [1, 1, 1, 1, 1, 1, 1, 1],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "green", 0: null },
        eye: { x: 5, y: 3 },
        mouth: { x: 7, y: 4 }
    },
    // Fish 29: Purple fin fish
    {
        name: "Purple Fin Fish",
        sizeFactor: 1.0,
        pixels: [
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [1, 1, 1, 1, 1, 1, 1, 0],
            [0, 1, 1, 1, 1, 1, 0, 0],
            [0, 0, 1, 1, 1, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
        ],
        colors: { 1: "purple", 0: null },
        eye: { x: 4, y: 3 },
        mouth: { x: 6, y: 4 }
    }
];

// Function to draw pixel art fish
export function drawPixelArt(ctx, fishData, x, y, size, direction, mouthOpen = false) {
    const pixelSize = size / fishData.pixels.length; // Assuming square pixels
    const halfSize = size / 2;

    ctx.save();
    ctx.translate(x + halfSize, y + halfSize);
    if (direction === 'left') {
        ctx.scale(-1, 1);
    }
    ctx.translate(-halfSize, -halfSize); // Translate back for drawing from top-left of fish bounding box

    for (let row = 0; row < fishData.pixels.length; row++) {
        for (let col = 0; col < fishData.pixels[row].length; col++) {
            const pixelValue = fishData.pixels[row][col];
            const color = fishData.colors[pixelValue];
            if (color) {
                ctx.fillStyle = color;
                ctx.fillRect(col * pixelSize, row * pixelSize, pixelSize, pixelSize);
            }
        }
    }

    // Draw eye (white for eyeball, black for pupil)
    if (fishData.eye) {
        // Eyeball (white)
        ctx.fillStyle = 'white';
        ctx.beginPath();
        ctx.arc(fishData.eye.x * pixelSize, fishData.eye.y * pixelSize, pixelSize * 0.4, 0, Math.PI * 2);
        ctx.fill();

        // Pupil (black)
        ctx.fillStyle = 'black';
        ctx.beginPath();
        ctx.arc(fishData.eye.x * pixelSize + (direction === 'right' ? pixelSize * 0.1 : -pixelSize * 0.1), fishData.eye.y * pixelSize, pixelSize * 0.2, 0, Math.PI * 2);
        ctx.fill();
    }

    // Draw mouth (line or arc)
    if (fishData.mouth) {
        ctx.strokeStyle = 'black';
        ctx.lineWidth = pixelSize * 0.2;
        ctx.beginPath();
        const mouthX = fishData.mouth.x * pixelSize;
        const mouthY = fishData.mouth.y * pixelSize;

        if (mouthOpen) {
            ctx.arc(mouthX, mouthY, pixelSize * 0.8, Math.PI * 0.7, Math.PI * 1.3); // Open mouth
        } else {
            ctx.moveTo(mouthX - pixelSize * 0.5, mouthY);
            ctx.lineTo(mouthX + pixelSize * 0.5, mouthY); // Closed mouth
        }
        ctx.stroke();
    }

    ctx.restore();
}
